package com.practice.tetris.ui;

import com.practice.tetris.ui.layers.*;

import javax.swing.*;
import java.awt.*;
import java.net.URL;

/**
 * Created by Zhouyue on 2015/6/6.
 */
public class PanelGame extends JPanel {

    private Layer[] layers = null;

    public PanelGame() {
        layers = new Layer[]{
                new LayerBackground(0, 0, 0, 0),
                new LayerRankAll(40, 32, 334, 279),
                new LayerRankLocal(40, 343, 334, 279),
                new LayerGame(414, 32, 334, 590),
                new LayerButton(788, 32, 334, 124),
                new LayerNext(788, 188, 176, 148),
                new LayerLevel(964, 188, 158, 148),
                new LayerScore(788, 368, 334, 200)
    };
    }

    @Override
    protected void paintComponent(Graphics g) {
        for (Layer layer : layers) {
            layer.paint(g);
        }
    }
}
